home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / coding / 80x86 / rzr92asm.lzh / party.asm < prev    next >
Assembly Source File  |  1992-12-29  |  48KB  |  1,670 lines

  1.            .386
  2.            assume cs:_code, ds:_code
  3.  
  4. ─────────────────────────────────────────────────────────────────────────────
  5. _Stack Segment Para Stack 'Stack' use16
  6.     db 512 dup (?)
  7. _Stack EndS
  8. ─────────────────────────────────────────────────────────────────────────────
  9. ; The Externals
  10. ─────────────────────────────────────────────────────────────────────────────
  11.  
  12. Procedures:
  13.  
  14. EXTRN  INITIALIZE:FAR            ; Initializes the modplayer for given
  15.                                  ; sounddevice and replayrate
  16.  
  17. EXTRN  LOADMODULE:FAR            ; Loads the Module into memory
  18.  
  19. EXTRN  STARTPLAYING:FAR          ; Starts playing the module
  20.  
  21. EXTRN  STOPPLAYING:FAR           ; Stops playing the module
  22.  
  23. EXTRN  DEALLOC:FAR               ; Deallocates and erases the module
  24.                                  ; from memory
  25.  
  26. EXTRN  ASKINIT:FAR
  27.  
  28. Variables:
  29.  
  30. EXTRN  SOUNDDEVICE:WORD          ; The Sounddevice number
  31.  
  32. EXTRN  TIMERSPEED:WORD           ; The replayrate 1193182/Hertz
  33.  
  34. EXTRN  SBDMA:WORD                ; SoundBlaster's DMA-Channel
  35.  
  36. EXTRN  SBIRQNR:WORD              ; SoundBlaster's IRQ-Number
  37.  
  38. Special_Variables:
  39.  
  40. EXTRN  BAR1,BAR2,BAR3,BAR4:WORD  ; Selfdecrementing Bars, see the docs
  41.  
  42. EXTRN  SHOWPATTERNS:Word         ; Shows the patterns
  43.  
  44. EXTRN  MASTERVOLUME:Word         ; Mastervolume from 0 to 64
  45.  
  46. ─────────────────────────────────────────────────────────────────────────────
  47. _Data  Segment Para Public 'Data' use16
  48.        Filename db 'Odd.mod',0
  49.  
  50.        Error1   Db 13,10,10,7,'Module not found',13,10,'$'
  51.        PlayMess Db 13,10,10,'Playing . . .',13,10
  52.                 Db 'Press ESCAPE to quit$'
  53.  
  54. _Data  EndS
  55.  
  56. ─────────────────────────────────────────────────────────────────────────────
  57.  
  58.  
  59. _stack     segment stack 'stack' use16
  60.            db 128 dup (0)
  61. _stack     ends
  62.  
  63. double     segment use16
  64. screen     db 65535 dup(0)
  65. double     ends
  66.  
  67. _code      segment use16
  68.            assume cs:_code, ds:_code
  69. outnow     dw 0
  70. scrollnr   dw 0
  71. scrollcnt  dw 100
  72. scroll     db 30,"  WELCOME TO THE PARTY 1992!  "
  73.            db 30,"WHICH OF COURSE TAKES PLACE..."
  74.            db 30,"    HERE IN AARS, DENMARK!    "
  75.            db 30,"YEAH, BUT YOU MIGHT NOT LIKE A"
  76.            db 30,"  LITTLE PATRIOTISM, SO LETS  "
  77.            db 30,"      REMOVE THE FLAG...      ",90
  78.            db 30,"    SO, HOW ABOUT THIS???     ",99,5,91
  79.            db 30,"THIS MIGHT SEEM LIKE NOTHING..",81
  80.            db 30,"   BUT WHAT ABOUT IT NOW???   "
  81.            db 30," OW MY EYES - BETTER TAKE IT  ",90
  82.            db 30,"AWAY...THE NEXT VECTOR WILL BE",99,10
  83.            db 30,"   SOMETHING DIFFERENT.....   ",91
  84.            db 30,"SHIT! I FORGOT TO TURN OFF THE"
  85.            db 30,"    'GEL'-EFFECT....THERE!    ",80
  86.            db 30,"   HEHE.....IS THIS BETTER?   ",90
  87.            db 30,"    'DIAMONDS ARE FOREVER'    ",99,7,91
  88.            db 30,"OR ARE THEY? WELL THIS ONE IS "
  89.            db 30," NOT! LETS REPLACE IT WITH A  ",90
  90.            db 30,"RUBINE....LETS PROCEED TO SOME",99,2,91
  91.            db 30,"GREETINGS.....WHAT THE FUCK IS"
  92.            db 30,"MY KEY DOING HERE???? I BETTER",81
  93.            db 30,"GRAB IT, SO I DON'T LOSE IT...",90
  94.            db 30,"GREETINGS GOES OUT TO.........",80,99,12,91
  95.            db 30,"ALL RAZOR DUDES, ESPECIALLY A "
  96.            db 30,"DUDE FROM ITALY, RANDALL FLAGG",90
  97.            db 30,"HERE YOU GO, BUDDY............",99,11,91
  98.            db 30,"AN ITALIAN FLAG ESPECIALLY 4 U",81
  99.            db 30,"  GOT A LITTLE SHAKY, EHH???  ",90
  100.            db 30,"ALSO GREETINGS TO:    CASCADA,",80,99,9,91
  101.            db 30,"THE PHONEY CODERS, FUTURE CREW"
  102.            db 30,"   CODEBLASTERS & FAIRLIGHT   ",90
  103.            db 30,"  NOW THE RAZOR TRIANGLE....  ",99,4,91
  104.            db 30,"   THAT WAS ALMOST THE MOST   "
  105.            db 30,"MOST DIFFICULT OBJECT TO MAKE!",90
  106.            db 30,"BUT ILL STOP WASTING YOUR TIME",99,13,91
  107.            db 30,"LETS PROCEED TO THE FINAL PART"
  108.            db 30,"RAZOR - KICKING ASS IN 1993!!!",91
  109.            db 30,"                              "
  110.            db 10 dup(255)
  111. boldfont   label byte
  112.            include bold.db
  113. logo       label byte
  114.            include party.db
  115. sinus      label word
  116.            include sinus.db
  117. cosinus    label word
  118.            include cosinus.db
  119. ddac       db 768 dup(0)
  120. dac        db 0,0,0,0,0,63
  121.            i = 0
  122.            REPT 64
  123.            db i,0,0
  124.            i = i + 1
  125.            ENDM
  126.            i = 63
  127.            REPT 64
  128.            db 0,0,i
  129.            i = i - 1
  130.            ENDM
  131.            i = 63
  132.            REPT 64
  133.            db 0,i,0
  134.            i = i - 1
  135.            ENDM
  136.            ; color 194
  137.            db 51 dup(0)
  138.            db 3 dup(64),3 dup(61),3 dup(58),3 dup(55)
  139.            db 3 dup(52),3 dup(49),3 dup(46),3 dup(43)
  140.            db 3 dup(40),3 dup(37),3 dup(34),3 dup(31)
  141.            db 3 dup(28),3 dup(25),3 dup(22),3 dup(19)
  142.            db 0,0,60,0,0,50,0,0,40,0,0,30,0,0,20
  143.            ; color 232
  144.            i = 20
  145.            REPT 8
  146.            db 0,i,i
  147.            i = i + 6
  148.            ENDM
  149.            i = 63
  150.            REPT 8
  151.            db 0,0,i
  152.            i = i - 5
  153.            ENDM
  154.            ; color 248
  155.            db 63,0,0,   0,63,0,   0,0,63,   63,63,0,   63,0,63,   0,63,63,   63,63,63
  156. x1         dw 0
  157. y1         dw 0
  158. x2         dw 0
  159. y2         dw 0
  160. time       dw 0
  161. xvcalc     dw 0
  162. yvcalc     dw 0
  163. biggest    db 0
  164. xvars      dw 0,0,0,0,0
  165. yvars      dw 0,0,0,0,0
  166. firstbyte  dw 200 dup(320)
  167. lastbyte   dw 200 dup(-1)
  168. xupdate    dw 320,-1
  169. yupdate    dw 200,-1
  170. _xadd       dw 160
  171. _yadd       dw 100
  172. xaddsin    dw 0
  173. yaddsin    dw 0
  174. dacup      dw 0
  175. dacdown    dw 0
  176. the_list   dw 50 dup(0)
  177. checked    dw 50 dup(0)
  178. vx         dw 0
  179. vy         dw 0
  180. vz         dw 0
  181. vxadd      dw 4
  182. vyadd      dw 3
  183. vzadd      dw 2
  184. vxsec      dw 88
  185. vysec      dw 45
  186. vzsec      dw 55
  187.            i = 0
  188. putsins    dw 0
  189. pson       db 0
  190.  
  191. color      db 0
  192. vectors    dw 0
  193. sides      dw 0
  194. xnval      dw 120 dup(0)
  195. ynval      dw 120 dup(0)
  196. znval      dw 120 dup(0)
  197. colordata  dw 120 dup(0)
  198. colors     dw 120 dup(0)
  199. bcolor     dw 0
  200. xxval      dw 120 dup(0)
  201. yyval      dw 120 dup(0)
  202. zzval      dw 120 dup(0)
  203. pairs      dw 480 dup(0)
  204.  
  205. plane      dw 96
  206. dw 67
  207. dw 64
  208. dw 0,0,-2,0,2,0,-3,0,-3,0,0,-1,0,1,-1,0,1,0,-4,0,4,0,-4,4,4,-4,-7,7,7,-7,-7,-10
  209. dw -7,-10,-10,-7,-10,-7,-10,-10,-10,-18,-18,-17,-17,-7,7,-7,7,-5,-3,-5,-3,-5,-3
  210. dw -3,-5,3,5,3,5,3,5,5,3,7,10,10,7,7,7,10,10,10,18,18,17,17,10,10,-5,-3,-1,-3
  211. dw -4,-3,-2,3,1,3,5,3,2,3,4,3
  212. dw 0,0,0,2,0,-2,0,3,0,-3,3,2,5,2,2,5,2,3,0,3,0,-3,3,3,-3,-3,3,3,-3,-3,1,1,-1,-1
  213. dw 1,1,-1,-1,0,0,-1,0,-1,0,-1,3,3,-3,-3,3,3,8,8,8,8,3,3,3,3,8,8,8,8,3,3,1,1,-1
  214. dw -1,1,-1,1,-1,0,0,-1,0,-1,0,-1,0,2,0,-2,0,2,0,-2,0,2,0,-2,0,2,0,-2
  215. dw 0,4,6,6,6,6,8,8,8,8,10,12,13,12,17,16,17,19,21,21,21,21,21,21,21,21,26,26,26
  216. dw 26,26,28,26,28,40,40,40,40,28,39,39,40,40,42,42,41,41,41,41,30,30,36,36,40
  217. dw 40,40,40,30,30,36,36,40,40,40,40,26,28,28,26,40,40,40,40,28,40,40,42,42,39
  218. dw 39,41,41,41,41,45,45,45,45,41,41,41,41,45,45,45,45
  219.  
  220. dw 0,1,1,1
  221. dw 1,2,3,3,1,3,4,4,1,4,5,5,1,5,2,2,2,6,7,3,3,7,4,8,5,4,8,9,9,6,2,5,11,12,10,10
  222. dw 10,12,13,13,14,15,12,11,13,12,15,16,16,15,17,17,17,15,14,14,8,7,19,20,18,19
  223. dw 7,6,9,8,20,21,21,18,6,9,22,26,27,23,23,27,28,24,25,24,28,29,26,22,25,29
  224. dw 26,45,46,27,28,27,46,48,29,28,48,47,47,45,26,29,48,46,45,47,66,65,69,71,65,66
  225. dw 67,68,67,66,71,72,72,71,69,70,72,70,68,67,67,73,74,75,75,74,76,77,77,76,78,79
  226. dw 73,78,76,74,79,77,75,67,30,31,34,35,33,31,30,32,37,35,34,36,36,34,31,33,33,32
  227. dw 37,36,38,41,43,39,40,39,43,44,44,43,41,42,41,38,33,42,40,44,42,33,80,84,85,81
  228. dw 82,81,85,86,83,82,86,87,84,80,83,87,86,85,84,87,87,88,92,93,90,87,93,94,91,90
  229. dw 94,95,95,92,88,91,94,93,92,95,49,51,52,50,51,53,54,52,50,52,54,55,56,53,51,49
  230. dw 55,54,53,56,57,59,60,58,58,60,62,63,64,61,59,57,59,61,62,60,63,62,61,64
  231. dw 67 dup(0)
  232. special    dw 10
  233.            dw 16
  234.            dw 64
  235.            dw -50,-70,-50,0,50,70,50,0,0,0
  236.            dw 50,0,-50,-75,-50,0,50,75,0,0
  237.            dw -40,40,-40,40,-40,40,-40,40,-20,20
  238.            dw 0,2,1,1,   2,4,3,3,   4,6,5,5,   6,0,7,7
  239.            dw 0,1,7,7,   2,3,1,1,   4,5,3,3,   6,7,5,5
  240.            dw 0,8,2,2,   2,8,4,4,   4,8,6,6,   6,8,0,0
  241.            dw 1,3,9,9,   3,5,9,9,   5,7,9,9,   7,1,9,9
  242.            dw 16 dup(0)
  243. italflag   dw 16
  244.            dw 14
  245.            dw 64
  246.            dw -80,-80,-80,-80,80,80,80,80,-80,-80,-80,-80,80,80,80,80
  247.            dw 50,17,-17,-50,-50,-17,17,50,50,17,-17,-50,-50,-17,17,50
  248.            dw 8 dup(10),8 dup(-10)
  249.            dw 0,1,6,7,   1,2,5,6,   2,3,4,5,   15,14,9,8,   14,13,10,9,   13,12,11,10
  250.            dw 3,11,12,4,   8,0,7,15,   8,9,1,0,   9,10,2,1,   10,11,3,2
  251.            dw 5,4,12,13,   6,5,13,14,   7,6,14,15
  252.            dw 248,254,249, 248,254,249, 249,248, 248,254,249, 249,254,248
  253. stick      dw 32
  254.            dw 30
  255.            dw 128
  256.            dw -15,-25,-30,-30,-25,-15,-5,5,15,25,30,30,25,15,5,-5,-15,-25,-30,-30,-25,-15,-5,5,15,25,30,30,25,15,5,-5
  257.            dw 25,15,5,-5,-15,-25,-30,-30,-25,-15,-5,5,15,25,30,30,25,15,5,-5,-15,-25,-30,-30,-25,-15,-5,5,15,25,30,30
  258.            dw 120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,-120,-120,-120,-120,-120,-120,-120,-120,-120,-120,-120,-120,-120,-120,-120,-120
  259.            dw 0,1,2,3,   15,0,3,4,   14,15,4,5,   13,14,5,6
  260.            dw 12,13,6,7,   11,12,7,8,   8,9,10,11
  261.            dw 27,26,25,24,   27,24,23,28,   28,23,22,29,   29,22,21,30
  262.            dw 30,21,20,31,   31,20,19,16,   19,18,17,16
  263.            dw 0,16,17,1,   1,17,18,2,   2,18,19,3,   3,19,20,4
  264.            dw 4,20,21,5,   5,21,22,6,   6,22,23,7,   7,23,24,8
  265.            dw 8,24,25,9,   9,25,26,10,   10,26,27,11,   11,27,28,12
  266.            dw 12,28,29,13,   13,29,30,14,   14,30,31,15,   15,31,16,0
  267.            dw 14 dup(248), 8 dup(253,250,249,251)
  268. danishflag dw 32
  269.            dw 24
  270.            dw 64
  271.            dw -80,-80,-80,-80,-40,-20,80,80,80,80,-20,-40,-40,-40,-20,-20,-80,-80,-80,-80,-40,-20,80,80,80,80,-20,-40,-40,-40,-20,-20
  272.            dw 50,10,-10,-50,-50,-50,-50,-10,10,50,50,50,10,-10,-10,10,50,10,-10,-50,-50,-50,-50,-10,10,50,50,50,10,-10,-10,10
  273.            dw 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10
  274.            dw 0,1,12,11,   2,3,4,13,   10,15,8,9,   14,5,6,7
  275.            dw 27,28,17,16,   29,20,19,18,   23,22,21,30,   25,24,31,26
  276.            dw 9,8,24,25,   7,6,22,23,   6,5,21,22,   4,3,19,20
  277.            dw 3,2,18,19,   1,0,16,17,   0,11,27,16,   10,9,25,26
  278.            dw 11,4,5,10,   1,2,7,8,   26,21,20,27,   24,23,18,17
  279.            dw 8,7,23,24,   5,4,20,21,   2,1,17,18,   11,10,26,27
  280.            dw 16 dup(248),8 dup(254)
  281. key        dw 28
  282.            dw 24
  283.            dw 64
  284.            dw -50,-50,-20,-20,0,-20,-20,0,-20,0,20,20,50,50,-50,-50,-20,-20,0,-20,-20,0,-20,0,20,20,50,50
  285.            dw 115,35,35,5,-15,-35,-75,-95,-115,-125,-115,35,35,115,115,35,35,5,-15,-35,-75,-95,-115,-125,-115,35,35,115
  286.            dw 10,10,10,10,5,5,5,5,5,10,10,10,10,10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-10,-10,-10,-10,-10
  287.            dw 14,15,1,0,   0,13,27,14,   13,12,26,27,   12,11,25,26
  288.            dw 11,10,24,25,   10,9,23,24,   9,8,22,23,   8,7,21,22
  289.            dw 7,6,20,21,   6,5,19,20,   5,4,18,19,   4,3,17,18
  290.            dw 3,2,16,17,   2,1,15,16
  291.            dw 0,1,12,13,   2,3,4,11,   4,5,6,7,   7,8,9,10,   4,7,10,11
  292.            dw 27,26,15,14,   25,24,21,18,   24,23,22,21,   21,20,19,18,   18,17,16,25
  293.            dw 24 dup(0)
  294.            dw 14 dup(249),10 dup(250)
  295. opencube   dw 8
  296.            dw 10
  297.            dw 64
  298.            dw -70,-70,70,70,-70,-70,70,70
  299.            dw 70,-70,-70,70,70,-70,-70,70
  300.            dw 70,70,70,70,-70,-70,-70,-70
  301.            dw 4,0,3,7,   0,1,2,3,   7,6,5,4,   3,2,6,7,   4,5,1,0
  302.            dw 0,4,7,3,   3,2,1,0,   4,5,6,7,   7,6,2,3,   0,1,5,4
  303.            dw 0,0,0,0,0,0,0,0
  304. pyramid    dw 4
  305.            dw 4
  306.            dw 64
  307.            dw -80,0,80,0
  308.            dw 40,-88,40,0
  309.            dw 40,40,40,-88
  310.            dw 0,1,3,0,   0,3,2,0,   3,1,2,3,   2,1,0,2
  311.            dw 0,0,0,0
  312. cube       dw 8
  313.            dw 6
  314.            dw 64
  315.            dw -70,-70,70,70,-70,-70,70,70
  316.            dw 70,-70,-70,70,70,-70,-70,70
  317.            dw 70,70,70,70,-70,-70,-70,-70
  318.            dw 0,1,2,3,   7,6,5,4,   3,2,6,7
  319.            dw 4,5,1,0,   4,0,3,7,   1,5,6,2
  320.            dw 0,0,0,0,0,0
  321. splitcube  dw 16
  322.            dw 12
  323.            dw 64
  324.            dw -70,-70,70,70,-70,-70,70,70,-70,-70,70,70,-70,-70,70,70
  325.            dw 70,-70,-70,70,70,-70,-70,70,70,-70,-70,70,70,-70,-70,70
  326.            dw 70,70,70,70,20,20,20,20,-20,-20,-20,-20,-70,-70,-70,-70
  327.            dw 0,1,2,3,   7,6,5,4,   3,2,6,7,   4,5,1,0,   4,0,3,7,   1,5,6,2
  328.            dw 8,9,10,11, 15,14,13,12, 11,10,14,15, 12,13,9,8, 9,13,14,10, 12,8,11,15
  329.            dw 12 dup(0)
  330. star       dw 10
  331.            dw 16
  332.            dw 64
  333.            dw -20,20,20,-20,-100,0,100,0,0,0
  334.            dw -20,-20,20,20,0,-100,0,100,0,0
  335.            dw 0,0,0,0,0,0,0,0,-100,100
  336.            dw 0,5,9,0,   5,1,9,5,   9,1,6,9,   9,6,3,9
  337.            dw 7,9,3,7,   2,9,7,2,   4,9,2,4,   4,0,9,4
  338.            dw 0,8,5,0,   5,8,1,5,   8,6,1,8,   8,3,6,8
  339.            dw 7,3,8,7,   2,7,8,2,   4,2,8,4,   4,8,0,4
  340.            dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  341. diamond    dw 13
  342.            dw 17
  343.            dw 64
  344.            dw -100,-100,-50,50,100,100,50,-50,-50,-50,50,50,0
  345.            dw 50,-50,-100,-100,-50,50,100,100,50,-50,-50,50,0
  346.            dw 0,0,0,0,0,0,0,0,40,40,40,40,-120
  347.            dw 0,1,9,8,   9,2,3,10,   11,10,4,5,   7,8,11,6,  1,2,9,1
  348.            dw 10,3,4,10,   6,11,5,6,   0,8,7,0,   8,9,10,11
  349.            dw 7,12,0,7,   0,12,1,0,   1,12,2,1,   2,12,3,2
  350.            dw 3,12,4,3,   4,12,5,4,   5,12,6,5,   6,12,7,6
  351.            dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  352. rubine     dw 16
  353.            dw 18
  354.            dw 64
  355.            dw -100,-100,-50,50,100,100,50,-50,-50,-50,50,50,-50,-50,50,50
  356.            dw 50,-50,-100,-100,-50,50,100,100,50,-50,-50,50,50,-50,-50,50
  357.            dw 0,0,0,0,0,0,0,0,40,40,40,40,-40,-40,-40,-40
  358.            dw 0,1,9,8,   9,2,3,10,   11,10,4,5,   7,8,11,6,  1,2,9,1
  359.            dw 10,3,4,10,   6,11,5,6,   0,8,7,0,   8,9,10,11
  360.            dw 5,4,14,15,   14,3,2,13,   12,13,1,0,   6,15,12,7,   4,3,14,4
  361.            dw 13,2,1,13,   7,12,0,7,   5,15,6,5,   15,14,13,12
  362.            dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  363. cubehole   dw 24
  364.            dw 16
  365.            dw 64
  366.            dw -80,-80, 80, 80,-80,-80, 80, 80,-40,-40, 40, 40,-80,-80, 80, 80,-80,-80, 80, 80,-40,-40, 40, 40
  367.            dw  80,-80,-80, 80, 40,-40,-40, 40, 40,-40,-40, 40, 80,-80,-80, 80, 40,-40,-40, 40, 40,-40,-40, 40
  368.            dw  40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40
  369.            dw 0,4,7,3,   4,5,9,8,   5,1,2,6,   11,10,6,7
  370.            dw 0,3,15,12,   3,2,14,15,   2,1,13,14,   1,0,12,13
  371.            dw 8,9,21,20,   9,10,22,21,   10,11,23,22,   11,8,20,23
  372.            dw 15,19,16,12,   18,14,13,17,   19,18,22,23,   20,21,17,16
  373.            dw 4 dup(250),4 dup(0),4 dup(0),4 dup(250)
  374. ring       dw 32
  375.            dw 32
  376.            dw 64
  377.            dw -40,-80,-80,-40,40,80,80,40,   -40,-40,-20,20,40,40,20,-20,-40,-80,-80,-40,40,80,80,40,   -40,-40,-20,20,40,40,20,-20
  378.            dw 80,40,-40,-80,-80,-40,40,80,   20,-20,-40,-40,-20,20,40,40,80,40,-40,-80,-80,-40,40,80,   20,-20,-40,-40,-20,20,40,40
  379.            dw 30,30,30,30,30,30,30,30,40,40,40,40,40,40,40,40,-30,-30,-30,-30,-30,-30,-30,-30,-40,-40,-40,-40,-40,-40,-40,-40
  380.            dw 1,8,15,0,   2,9,8,1,   3,10,9,2,   4,11,10,3
  381.            dw 5,12,11,4,   6,13,12,5,   7,14,13,6,   0,15,14,7
  382.            dw 0,16,17,1,   1,17,18,2,   2,18,19,3,   3,19,20,4
  383.            dw 4,20,21,5,   5,21,22,6,   6,22,23,7,   7,23,16,0
  384.            dw 9,25,24,8,   10,26,25,9,   11,27,26,10,   12,28,27,11
  385.            dw 13,29,28,12,   14,30,29,13,   15,31,30,14,   8,24,31,15
  386.            dw 17,24,25,18,   18,25,26,19,   19,26,27,20,   20,27,28,21
  387.            dw 21,28,29,22,   22,29,30,23,   23,30,31,16,   16,31,24,17
  388.            dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  389. objbase    dw 50 dup(0)
  390.  
  391. calcoffs   macro     ;(x,y) = (cx,ax)
  392.            mov bx,320
  393.            mul bx
  394.            add ax,cx
  395.            endm
  396.  
  397. savedac    proc      near
  398.            mov       dx,3c8h
  399.            mov       al,0
  400.            out       dx,al
  401.            mov       cx,256
  402.            mov       dx,3c9h
  403.            sti
  404.            push      ax
  405.            push      cx
  406.            push      dx
  407. check:     mov       dx,3dah
  408.            in        al,dx
  409.            test      al,1
  410.            jz        check
  411.            pop       dx
  412.            pop       cx
  413.            pop       ax
  414. step:      push      ax
  415.            push      dx
  416.            mov       dx,3dah
  417. instep:    in        al,dx
  418.            test      al,1
  419.            jz        instep
  420.            pop       dx
  421.            pop       ax
  422.            lodsb
  423.            out       dx,al
  424.            lodsb
  425.            out       dx,al
  426.            lodsb
  427.            out       dx,al
  428.            loop      step
  429.            cli
  430.            ret
  431. savedac    endp
  432.  
  433. fontletter proc near               ; cx,ax = x,y     bh = color    dl = char
  434.            mov si,cs
  435.            mov ds,si
  436.            mov si,offset boldfont
  437.            add si,79
  438.            push bx
  439.            push dx
  440.            CALCOFFS
  441.            pop dx
  442.            pop bx
  443.            mov di,0a000h
  444.            mov es,di
  445.            mov di,ax
  446.            mov ax,dx
  447.            xor ah,ah
  448.            shl ax,4
  449.            add si,ax
  450.            mov cx,16
  451. flnext:
  452.            lodsb
  453.            test al,128
  454.            je fl2
  455.            mov es:[di],bh
  456. fl2:
  457.            test al,64
  458.            je fl3
  459.            mov es:[di+1],bh
  460. fl3:
  461.            test al,32
  462.            je fl4
  463.            mov es:[di+2],bh
  464. fl4:
  465.            test al,16
  466.            je fl5
  467.            mov es:[di+3],bh
  468. fl5:
  469.            test al,8
  470.            je fl6
  471.            mov es:[di+4],bh
  472. fl6:
  473.            test al,4
  474.            je fl7
  475.            mov es:[di+5],bh
  476. fl7:
  477.            test al,2
  478.            je fl8
  479.            mov es:[di+6],bh
  480. fl8:
  481.            test al,1
  482.            je fl9
  483.            mov es:[di+7],bh
  484. fl9:
  485.            add di,320
  486.            inc bh
  487.            loop flnext
  488.            ret
  489. fontletter endp
  490.  
  491.            ; ds:si = text
  492.            ; cx,ax = x,y
  493.            ; di = no. of chars
  494.            ; bh = color
  495. writestr   proc near
  496. wsn:
  497.            push cx
  498.            push ax
  499.            push ds
  500.            push si
  501.            push bx
  502.            push di
  503.            mov dl,ds:[si]
  504.            call fontletter
  505.            pop di
  506.            pop bx
  507.            pop si
  508.            pop ds
  509.            pop ax
  510.            pop cx
  511.            add cx,9
  512.            inc si
  513.            dec di
  514.            cmp di,0
  515.            jne wsn
  516.            ret
  517. writestr   endp
  518.  
  519.  
  520. sort_list  proc near
  521.            mov cx,cs:sides
  522. nextentry:
  523.            mov si,cx
  524.            dec si
  525.            shl si,3
  526.            mov bx,cs:pairs[si]
  527.            shl bx,1
  528.            mov ax,cs:znval[bx]
  529.            mov di,ax                    ; max
  530.            mov bp,ax                    ; min
  531.            mov dx,ax                    ; added
  532.            mov bx,cs:pairs[si+2]
  533.            shl bx,1
  534.  
  535.            cmp di,cs:znval[bx]
  536.            jg blx1
  537.            mov di,cs:znval[bx]
  538. blx1:
  539.            cmp bp,cs:znval[bx]
  540.            jng btx1
  541.            mov bp,cs:znval[bx]
  542. btx1:
  543.            add dx,cs:znval[bx]
  544.            cmp cs:znval[bx],ax
  545.            jg ent2
  546.            mov ax,cs:znval[bx]
  547. ent2:
  548.            mov bx,cs:pairs[si+4]
  549.            shl bx,1
  550.  
  551.            cmp di,cs:znval[bx]
  552.            jg blx2
  553.            mov di,cs:znval[bx]
  554. blx2:
  555.            cmp bp,cs:znval[bx]
  556.            jng btx2
  557.            mov bp,cs:znval[bx]
  558. btx2:
  559.            add dx,cs:znval[bx]
  560.            cmp cs:znval[bx],ax
  561.            jg ent3
  562.            mov ax,cs:znval[bx]
  563. ent3:
  564.            mov bx,cs:pairs[si+6]
  565.            shl bx,1
  566.  
  567.            cmp di,cs:znval[bx]
  568.            jg blx3
  569.            mov di,cs:znval[bx]
  570. blx3:
  571.            cmp bp,cs:znval[bx]
  572.            jng btx3
  573.            mov bp,cs:znval[bx]
  574. btx3:
  575.            add dx,cs:znval[bx]
  576.            cmp cs:znval[bx],ax
  577.            jg ent4
  578.            mov ax,cs:znval[bx]
  579. ent4:
  580.            mov si,cx
  581.            dec si
  582.            mov bx,cs:bcolor
  583.            sub di,bp
  584.            sar di,1
  585.            sub bx,di
  586. ;           mov bx,dx
  587. ;           sar bx,3
  588. ;           neg bx
  589. ;           add bx,32
  590.            mov di,si
  591.            shl si,1
  592.            mov cs:checked[si],ax        ; checked[] = max. z-val in side
  593.            mov cs:the_list[si],di       ; the_list[] = min->max (fx. 0-7)
  594.            cmp cs:colordata[si],0
  595.            jne nexxxx
  596.            mov cs:colors[si],bx
  597.            jmp nexxx
  598. nextentryxxx:
  599.            jmp nextentry
  600. nexxxx:
  601.            mov bx,cs:colordata[si]
  602.            mov cs:colors[si],bx
  603. nexxx:
  604.            loop nextentryxxx
  605.            mov cx,cs:sides
  606. nextcx:
  607.            dec cx
  608.            mov dx,cx
  609. nextdx:
  610.            dec dx
  611.  
  612.            mov si,cx
  613.            shl si,1
  614.            mov di,dx
  615.            shl di,1
  616.            mov ax,cs:checked[di]
  617.            cmp ax,cs:checked[si]
  618.            jng donothing
  619.            xchg ax,cs:checked[si]
  620.            xchg ax,cs:checked[di]
  621.            mov ax,cs:the_list[di]
  622.            xchg ax,cs:the_list[si]
  623.            xchg ax,cs:the_list[di]
  624.            mov ax,cs:colors[di]
  625.            xchg ax,cs:colors[si]
  626.            xchg ax,cs:colors[di]
  627. donothing:
  628.            cmp dx,0
  629.            jne nextdx
  630.            cmp cx,1
  631.            jne nextcx
  632.            ret
  633. sort_list  endp
  634.  
  635. resetupd   proc near
  636.            mov cs:xupdate[0],200
  637.            mov cs:xupdate[2],-1
  638.            mov cs:yupdate[0],320
  639.            mov cs:yupdate[2],-1
  640.            ret
  641. resetupd   endp
  642.  
  643. cleardbl   proc near
  644.            cld
  645.            cmp cs:yupdate[0],200
  646.            je clout
  647.            mov di,double
  648.            mov es,di
  649.            mov di,offset screen
  650.  
  651.            mov cx,cs:xupdate[0]
  652.            mov ax,cs:yupdate[0]
  653.            CALCOFFS
  654.            add di,ax
  655.  
  656.            mov cx,cs:yupdate[2]
  657.            sub cx,cs:yupdate[0]
  658.            inc cx
  659.            mov bx,cs:xupdate[2]
  660.            sub bx,cs:xupdate[0]
  661.            inc bx
  662. cl1:
  663.            push cx
  664.            mov cx,bx
  665.            mov al,0
  666.            rep stosb
  667.            pop cx
  668.            add di,320
  669.            sub di,bx
  670.            loop cl1
  671. clout:
  672.            ret
  673. cleardbl   endp
  674.  
  675. updsins    proc near
  676.            mov ax,cs:putsins
  677.            add ax,18
  678.            cmp ax,359
  679.            jna nxttt
  680.            sub ax,360
  681. nxttt:
  682.            mov cs:putsins,ax
  683.            ret
  684. updsins    endp
  685.  
  686. copydbl    proc near
  687.            cld
  688.            cmp cs:yupdate[0],200
  689.            je coout
  690.            mov si,double
  691.            mov ds,si
  692.            mov si,offset screen
  693.  
  694.            mov di,0a000h
  695.            mov es,di
  696.            mov di,0
  697.            mov bp,0
  698.  
  699.            mov cx,cs:xupdate[0]
  700.            mov ax,cs:yupdate[0]
  701.            CALCOFFS
  702.            add di,ax
  703.            add si,ax
  704.  
  705.            mov cx,cs:yupdate[2]
  706.            sub cx,cs:yupdate[0]
  707.            inc cx
  708.            mov bx,cs:xupdate[2]
  709.            sub bx,cs:xupdate[0]
  710.            inc bx
  711.            mov dx,cs:putsins
  712. co1:
  713.            push cx
  714.            mov cx,bx
  715.  
  716.  
  717.            cmp cs:pson,1
  718.            jne cdblcont
  719.            pusha
  720.            call updsins
  721.            popa
  722.            push si
  723.            mov si,cs:putsins
  724.            shl si,1
  725.            mov bp,cs:sinus[si]
  726.            sar bp,6
  727.            pop si
  728. cdblcont:
  729.            add di,bp
  730.            rep movsb
  731.            sub di,bp
  732.            pop cx
  733.            add di,320
  734.            add si,320
  735.            sub di,bx
  736.            sub si,bx
  737.            loop co1
  738. coout:
  739.            mov cs:putsins,dx
  740.            call updsins
  741.            call updsins
  742.            ret
  743. copydbl    endp
  744.  
  745.  
  746.                                         ; vector rotation procedure
  747.                                         ; clock cycles used:
  748.                                         ; 80286: 465          80386: 264
  749.                                         ; BX = X   CX = Y   BP = Z
  750. rotate     proc near
  751.                                         ; X-rotation
  752.                                         ; Y := cos(vx) * y - sin(vx) * z
  753.                                         ; Z := sin(vx) * y + cos(vx) * z
  754.            mov si,cs:vx
  755.            shl si,1                     ; si = angle x
  756.            mov ax,cs:cosinus[si]        ; ax = cosinus(angle x)
  757.            imul cx                      ; ax = cos(angle x) * y
  758.            mov di,ax                    ; store for later use
  759.            mov ax,cs:sinus[si]          ; ax = sinus(angle x)
  760.            imul bp                      ; ax = sin(angle x) * z
  761.            sub di,ax                    ; di = di-ax = cos(vx)*y - sin(vz)*z
  762.            sar di,8                     ; remove the (co)sin "256-factor"
  763.            mov es,di                    ; es = x-coordinate
  764.  
  765.            mov ax,cs:sinus[si]          ; ax = sinus(angle x)
  766.            imul cx                      ; ax = sin(angle x) * y
  767.            mov di,ax
  768.            mov ax,cs:cosinus[si]        ; ax = cosinus(angle x)
  769.            imul bp                      ; ax = cos(angle x) * z
  770.            add di,ax                    ; di = di-ax = sin(vx)*y + cos(vx)*z
  771.            sar di,8                     ; remove the (co)sin "256-factor"
  772.  
  773.            mov cx,es                    ; update y
  774.            mov bp,di                    ; update z
  775.  
  776.                                         ; Y-rotation
  777.                                         ; X :=  cos(vy) * xc + sin(vy) * zc
  778.                                         ; Z := -sin(vy) * xc + cos(vy) * zc
  779.            mov si,cs:vy
  780.            shl si,1                     ; si = angle y
  781.            mov ax,cs:cosinus[si]        ; ax = cosinus(angle y)
  782.            imul bx                      ; ax = cos(angle y) * x
  783.            mov di,ax
  784.            mov ax,cs:sinus[si]          ; ax = sin(angle y)
  785.            imul bp                      ; ax = sin(angle y) * z
  786.            add di,ax                    ; di = di+ax = cos(vy)*x + sin(vy)*z
  787.            sar di,8                     ; remove the (co)sin "256-factor"
  788.            mov es,di                    ; es = x-coordinate
  789.  
  790.            mov ax,cs:sinus[si]          ; ax = sinus(angle y)
  791.            neg ax                       ; ax = -sinus(angle y)
  792.            imul bx                      ; ax = -sin(angle y) * x
  793.            mov di,ax
  794.            mov ax,cs:cosinus[si]        ; ax = cosinus(angle y)
  795.            imul bp                      ; ax = cos(angle y) * z
  796.            add di,ax                    ; di = di-ax = sin(vy)*x - cos(vy)*z
  797.            sar di,8                     ; remove the (co)sin "256-factor"
  798.  
  799.            mov bx,es                    ; update x
  800.            mov bp,di                    ; update z
  801.  
  802.                                         ; Z-rotation
  803.                                         ; X := cos(vz) * xc - sin(vz) * yc
  804.                                         ; Y := sin(vz) * xc + cos(vz) * yc
  805.            mov si,cs:vz
  806.            shl si,1                     ; si = angle z
  807.            mov ax,cs:cosinus[si]        ; ax = cosinus(angle z)
  808.            imul bx                      ; ax = cos(angle z) * x
  809.            mov di,ax
  810.            mov ax,cs:sinus[si]          ; ax = sinus(angle z)
  811.            imul cx                      ; ax = sin(angle z) * y
  812.            sub di,ax                    ; di = di-ax = cos(vz)*x - sin(vz)*y
  813.            sar di,8                     ; remove the (co)sin "256-factor"
  814.            mov es,di                    ; es = x-coordinate
  815.  
  816.            mov ax,cs:sinus[si]          ; ax = sinus(angle z)
  817.            imul bx                      ; ax = sin(angle z) * x
  818.            mov di,ax
  819.            mov ax,cs:cosinus[si]        ; ax = cosinus(angle z)
  820.            imul cx                      ; ax = cos(angle z) * y
  821.            add di,ax                    ; di = di+ax = sin(vz)*x+cos(vz)*y
  822.            sar di,8                     ; remove the (co)sin "256-factor"
  823.  
  824.            mov bx,es                    ; update x
  825.            mov cx,di                    ; update y
  826.  
  827.            ret
  828. rotate     endp
  829.  
  830.                                         ; checks if a side is visible
  831.                                         ; clock cycles used:
  832.                                         ; 286: 66   386: 38
  833.                                         ; DI, SI, DX = x's
  834.                                         ; BP, DS, ES = y's
  835.                                         ; return: cx register...
  836.                                         ; cx > 0: side visible...else not...
  837. checkfront proc near
  838.            cmp di,si
  839.            jng cfc
  840.            mov ax,di
  841.            mov di,si
  842.            mov si,dx
  843.            mov dx,ax
  844.            mov ax,bp
  845.            mov bp,ds
  846.            mov bx,es
  847.            mov ds,bx
  848.            mov es,ax
  849. cfc:
  850.            cmp di,si
  851.            jng cfc2
  852.            mov ax,di
  853.            mov di,si
  854.            mov si,dx
  855.            mov dx,ax
  856.            mov ax,bp
  857.            mov bp,ds
  858.            mov bx,es
  859.            mov ds,bx
  860.            mov es,ax
  861. cfc2:
  862.            mov ax,dx                    ; ax = x3
  863.            sub ax,di                    ; ax = x3 - x1
  864.            mov bx,ds                    ; bx = y2
  865.            sub bx,bp                    ; bx = y2 - y1
  866.            imul bx                      ; ax = (x3-x1)*(y2-y1)
  867.            mov cx,ax                    ; save it...
  868.            mov ax,si                    ; ax = x2
  869.            sub ax,di                    ; ax = x2 - x1
  870.            mov bx,es                    ; bx = y3
  871.            sub bx,bp                    ; bx = y3 - y1
  872.            imul bx                      ; ax = (x2-x1)*(y3-y1)
  873.            sub cx,ax                    ; cx = (x3-x1)*(y2-y1)-(x2-x1)*(y3-y1)
  874.            ret
  875. checkfront endp
  876.  
  877. bigger     proc near
  878.            push bx
  879.            push bp
  880.            cmp bx,0h
  881.            jg big1
  882.            neg bx
  883. big1:
  884.            cmp bp,0h
  885.            jg big2
  886.            neg bp
  887. big2:
  888.            cmp bx,bp
  889.            jng bigr1
  890.            mov cs:biggest,0
  891.            pop bp
  892.            pop bx
  893.            cmp bx,0h
  894.            jg bigx1
  895.            neg bx
  896.            neg bp
  897.            mov ax,cs:x1
  898.            mov cx,cs:x2
  899.            mov cs:x1,cx
  900.            mov cs:x2,ax
  901.            mov ax,cs:y1
  902.            mov cx,cs:y2
  903.            mov cs:y1,cx
  904.            mov cs:y2,ax
  905. bigx1:
  906.            jmp bigend
  907. bigr1:
  908.            mov cs:biggest,1
  909.            pop bp
  910.            pop bx
  911.            cmp bp,0h
  912.            jg bigx2
  913.            neg bx
  914.            neg bp
  915.            mov ax,cs:x1
  916.            mov cx,cs:x2
  917.            mov cs:x1,cx
  918.            mov cs:x2,ax
  919.            mov ax,cs:y1
  920.            mov cx,cs:y2
  921.            mov cs:y1,cx
  922.            mov cs:y2,ax
  923. bigx2:
  924. bigend:
  925.            ret
  926. bigger     endp
  927.  
  928. putpixel   macro x,y,col
  929.            push bx
  930.            CALCOFFS
  931.            pop bx
  932.            mov di,ax
  933.            add di,offset screen
  934.            mov al,col
  935.            stosb
  936.            endm
  937.  
  938. checkin    proc near ; cx,ax=x,y.....
  939.            push bx
  940.            mov bx,ax
  941.            add bx,bx
  942.            cmp cx,cs:firstbyte[bx]
  943.            jg ci1
  944.            mov cs:firstbyte[bx],cx
  945. ci1:
  946.            cmp cx,cs:lastbyte[bx]
  947.            jng ci2
  948.            mov cs:lastbyte[bx],cx
  949. ci2:
  950.            cmp cx,cs:xupdate[0]
  951.            jg ci3
  952.            mov cs:xupdate[0],cx
  953.            sub cs:xupdate[0],8
  954. ci3:
  955.            cmp cx,cs:xupdate[2]
  956.            jng ci4
  957.            mov cs:xupdate[2],cx
  958.            add cs:xupdate[2],8
  959. ci4:
  960.            cmp ax,cs:yupdate[0]
  961.            jg ci5
  962.            mov cs:yupdate[0],ax
  963.            sub cs:yupdate[0],8
  964. ci5:
  965.            cmp ax,cs:yupdate[2]
  966.            jng ci6
  967.            mov cs:yupdate[2],ax
  968.            add cs:yupdate[2],8
  969. ci6:
  970.            pop bx
  971.            ret
  972. checkin    endp
  973.  
  974. line       proc near
  975.            mov di,double
  976.            mov es,di
  977.            mov bx,cs:x2
  978.            sub bx,cs:x1
  979.            mov bp,cs:y2
  980.            sub bp,cs:y1
  981.            cmp bx,0
  982.            jne lineproceed
  983.            cmp bp,0
  984.            jne lineproceed
  985.            mov cx,cs:x1
  986.            mov ax,cs:y1
  987.            call checkin
  988. ;           putpixel cx,ax,cs:color
  989.            jmp lineend
  990. lineproceed:
  991.            call bigger
  992.  
  993.            cmp cs:biggest,0
  994.            jne drawy
  995.  
  996.            mov si,bx
  997.            inc si
  998.  
  999.            mov cx,si
  1000. l1:
  1001.            push cx
  1002.            dec cx
  1003.            mov ax,bp
  1004.            imul cx
  1005.            idiv bx
  1006.            add ax,cs:y1
  1007.            add cx,cs:x1
  1008.            call checkin
  1009. ;           putpixel cx,ax,cs:color
  1010.            pop cx
  1011.            loop l1
  1012.            jmp lineend
  1013. drawy:
  1014.            mov si,bp
  1015.            inc si
  1016.  
  1017.            mov cx,si
  1018. l2:
  1019.            push cx
  1020.            push ax
  1021.            dec cx
  1022.            mov ax,bx
  1023.            imul cx
  1024.            idiv bp
  1025.            xchg ax,cx
  1026.            add ax,cs:y1
  1027.            add cx,cs:x1
  1028.            call checkin
  1029. ;           putpixel cx,ax,cs:color
  1030.            pop ax
  1031.            pop cx
  1032.            loop l2
  1033. lineend:
  1034.            ret
  1035. line       endp
  1036.  
  1037. newfill    proc near
  1038.            mov di,double
  1039.            mov es,di
  1040.            cld
  1041.            mov cx,200
  1042. nf1:
  1043.            mov bp,cx
  1044.            mov si,cx
  1045.            dec si
  1046.            add si,si
  1047.            cmp cs:firstbyte[si],320
  1048.            je nf2
  1049.            mov cx,cs:firstbyte[si]
  1050.            mov ax,bp
  1051.            CALCOFFS
  1052.            mov di,ax
  1053.            add di,offset screen
  1054.            mov cx,cs:lastbyte[si]
  1055.            sub cx,cs:firstbyte[si]
  1056.            inc cx
  1057.            mov al,cs:color
  1058.            rep stosb
  1059.            mov cs:lastbyte[si],-1
  1060.            mov cs:firstbyte[si],320
  1061.            mov cx,bp
  1062. nf2:
  1063.            loop nf1
  1064.            ret
  1065. newfill    endp
  1066.  
  1067.                                         ; makes side of vector...
  1068. makeside   proc near                    ; di = x-values, si = y..., cx = vectors
  1069.            push cx
  1070.            push di
  1071.            push si
  1072.            mov ax,cs:[di]
  1073.            push ax
  1074.            mov ax,cs:[di+2]
  1075.            push ax
  1076.            mov ax,cs:[di+4]
  1077.            push ax
  1078.            mov ax,cs:[si]
  1079.            push ax
  1080.            mov ax,cs:[si+2]
  1081.            push ax
  1082.            mov ax,cs:[si+4]
  1083.            push ax
  1084.            pop es
  1085.            pop ds
  1086.            pop bp
  1087.            pop dx
  1088.            pop si
  1089.            pop di
  1090.            call checkfront
  1091.            mov ax,cx
  1092.            pop si
  1093.            pop di
  1094.            pop cx
  1095.            cmp ax,0
  1096.            jng mout
  1097.            mov cs:xvcalc,0
  1098.            mov cs:yvcalc,0
  1099. msnext:
  1100.            push si
  1101.            push di
  1102.            push cx
  1103.            mov bx,cx
  1104.            dec bx
  1105.            shl bx,1
  1106.            mov ax,cs:[di+bx]
  1107.            add cs:xvcalc,ax
  1108.            mov cs:x1,ax
  1109.            mov ax,cs:[di+bx+2]
  1110.            mov cs:x2,ax
  1111.            mov ax,cs:[si+bx]
  1112.            add cs:yvcalc,ax
  1113.            mov cs:y1,ax
  1114.            mov ax,cs:[si+bx+2]
  1115.            mov cs:y2,ax
  1116.            mov ax,cs:_xadd
  1117.            add cs:x1,ax
  1118.            add cs:x2,ax
  1119.            mov ax,cs:_yadd
  1120.            add cs:y1,ax
  1121.            add cs:y2,ax
  1122.            call line
  1123.            pop cx
  1124.            pop di
  1125.            pop si
  1126.            loop msnext
  1127.            call newfill
  1128. mout:
  1129.            ret
  1130. makeside   endp
  1131.  
  1132. rotvectors proc near
  1133.            mov cx,cs:vectors
  1134. rva:
  1135.            push cx
  1136.            mov si,cx
  1137.            dec si
  1138.            shl si,1
  1139.            mov bx,cs:xxval[si]
  1140.            mov cx,cs:yyval[si]
  1141.            mov bp,cs:zzval[si]
  1142.            push si
  1143.            call rotate
  1144.            pop si
  1145.            sar bx,1
  1146.            sar cx,1
  1147.            sar bp,1
  1148.            mov cs:xnval[si],bx
  1149.            mov cs:ynval[si],cx
  1150.            mov cs:znval[si],bp
  1151.            pop cx
  1152.            loop rva
  1153.            ret
  1154. rotvectors endp
  1155.  
  1156. drawvect   proc near
  1157.            mov cx,cs:sides
  1158. dsa:
  1159.            push cx
  1160.            mov si,cx
  1161.            dec si
  1162.            shl si,1
  1163.            mov ax,cs:colors[si]
  1164.            mov cs:color,al
  1165.            mov si,cs:the_list[si]
  1166.            shl si,3
  1167.  
  1168.            mov di,cs:pairs[si]
  1169.            shl di,1
  1170.            mov ax,cs:xnval[di]
  1171.            mov cs:xvars[0],ax
  1172.            mov cs:xvars[8],ax
  1173.            mov ax,cs:ynval[di]
  1174.            mov cs:yvars[0],ax
  1175.            mov cs:yvars[8],ax
  1176.  
  1177.            mov di,cs:pairs[si+2]
  1178.            shl di,1
  1179.            mov ax,cs:xnval[di]
  1180.            mov cs:xvars[2],ax
  1181.            mov ax,cs:ynval[di]
  1182.            mov cs:yvars[2],ax
  1183.  
  1184.            mov di,cs:pairs[si+4]
  1185.            shl di,1
  1186.            mov ax,cs:xnval[di]
  1187.            mov cs:xvars[4],ax
  1188.            mov ax,cs:ynval[di]
  1189.            mov cs:yvars[4],ax
  1190.  
  1191.            mov di,cs:pairs[si+6]
  1192.            shl di,1
  1193.            mov ax,cs:xnval[di]
  1194.            mov cs:xvars[6],ax
  1195.            mov ax,cs:ynval[di]
  1196.            mov cs:yvars[6],ax
  1197.  
  1198.            mov di,offset xvars
  1199.            mov si,offset yvars
  1200.            mov cx,4
  1201.            call makeside
  1202.            pop cx
  1203.            jmp dsaaa
  1204. dsaa:
  1205.            jmp dsa
  1206. dsaaa:
  1207.            loop dsaa
  1208.            ret
  1209. drawvect   endp
  1210.  
  1211. updvectors proc near
  1212.            mov ax,cs:vxadd
  1213.            add cs:vx,ax
  1214.            cmp cs:vx,359
  1215.            jna sdf
  1216.            sub cs:vx,360
  1217. sdf:
  1218.            mov ax,cs:vyadd
  1219.            add cs:vy,ax
  1220.            cmp cs:vy,359
  1221.            jna dfy
  1222.            sub cs:vy,360
  1223. dfy:
  1224.            mov ax,cs:vzadd
  1225.            add cs:vz,ax
  1226.            cmp cs:vz,359
  1227.            jna dfyz
  1228.            sub cs:vz,360
  1229. dfyz:
  1230.            add cs:xaddsin,2
  1231.            cmp cs:xaddsin,359
  1232.            jna dfsyz
  1233.            sub cs:xaddsin,360
  1234. dfsyz:
  1235.            add cs:yaddsin,1
  1236.            cmp cs:yaddsin,359
  1237.            jna dfsyzg
  1238.            sub cs:yaddsin,360
  1239. dfsyzg:
  1240.            mov bx,cs:xaddsin
  1241.            shl bx,1
  1242.            mov ax,cs:sinus[bx]
  1243.            sar ax,2
  1244.            add ax,160
  1245.            mov cs:_xadd,ax
  1246.            ret
  1247. updvectors endp
  1248.  
  1249. changeall  proc near                    ; si = source...
  1250.            mov cx,cs:[si]               ; number of vectors
  1251.            mov cs:vectors,cx
  1252.            mov dx,cs:[si+2]             ; number of sides
  1253.            mov cs:sides,dx
  1254.            mov dx,cs:[si+4]             ; number of sides
  1255.            mov cs:bcolor,dx
  1256.  
  1257.            mov ax,cs
  1258.            mov es,ax
  1259.            mov ds,ax
  1260.  
  1261.            mov di,offset xxval          ; x-data
  1262.            add si,6
  1263.            mov cx,cs:vectors
  1264.            rep movsw
  1265.  
  1266.            mov di,offset yyval          ; y-data
  1267.            mov cx,cs:vectors
  1268.            rep movsw
  1269.  
  1270.            mov di,offset zzval          ; z-data
  1271.            mov cx,cs:vectors
  1272.            rep movsw
  1273.  
  1274.            mov di,offset pairs          ; side-data
  1275.            mov cx,cs:sides
  1276.            shl cx,2
  1277.            rep movsw
  1278.  
  1279.            mov di,offset colordata      ; color-data
  1280.            mov cx,cs:sides
  1281.            shl cx,2
  1282.            rep movsw
  1283.            ret
  1284. changeall  endp
  1285.  
  1286. handletext proc near
  1287.            dec cs:scrollcnt
  1288.            cmp cs:scrollcnt,0
  1289.            jne through
  1290.  
  1291.            mov si,cs
  1292.            mov ds,si
  1293.            mov si,offset scroll
  1294.            add si,cs:scrollnr
  1295.            lodsb
  1296.            cmp al,30
  1297.            je thetext
  1298.            cmp al,99
  1299.            je newobj
  1300.            cmp al,90
  1301.            je fade_down
  1302.            cmp al,91
  1303.            je fade_up
  1304.            cmp al,255
  1305.            je startover
  1306.            cmp al,80
  1307.            je ps80
  1308.            cmp al,81
  1309.            je ps81
  1310.            inc cs:scrollnr
  1311.            jmp through
  1312. startover:
  1313.            mov cs:scrollcnt,1
  1314.            mov cs:scrollnr,0
  1315.            mov cs:outnow,1
  1316.            jmp through
  1317. newobj:
  1318.            mov cs:scrollcnt,1
  1319.            lodsb
  1320.            xor ah,ah
  1321.            mov bx,ax
  1322.            shl bx,1
  1323.            mov si,cs:objbase[bx]
  1324.            call changeall
  1325.            add cs:scrollnr,2
  1326.            jmp through
  1327. thetext:
  1328.            mov di,0a000h
  1329.            mov es,di
  1330.            mov di,0
  1331.            mov cx,17*160
  1332.            mov ax,0    ;3e3eh
  1333.            cld
  1334.            rep stosw
  1335.            mov di,30
  1336.            mov cx,25
  1337.            mov ax,0
  1338.            mov bh,232
  1339.            call writestr
  1340.            mov cs:scrollcnt,100
  1341.            add cs:scrollnr,31
  1342.            jmp through
  1343. fade_down:
  1344.            add cs:scrollnr,1
  1345.            mov cs:scrollcnt,1
  1346.            mov cs:dacdown,60
  1347.            jmp through
  1348. fade_up:
  1349.            add cs:scrollnr,1
  1350.            mov cs:scrollcnt,1
  1351.            mov cs:dacup,60
  1352.            jmp through
  1353. ps80:
  1354.            mov cs:pson,0
  1355.            add cs:scrollnr,1
  1356.            mov cs:scrollcnt,1
  1357.            mov cs:putsins,0
  1358.            jmp through
  1359. ps81:
  1360.            mov cs:pson,1
  1361.            add cs:scrollnr,1
  1362.            mov cs:scrollcnt,1
  1363.            mov cs:putsins,0
  1364.            jmp through
  1365. through:
  1366.            ret
  1367. handletext endp
  1368.  
  1369. putlogo    proc near
  1370.            mov di,0a000h
  1371.            mov es,di
  1372.            mov di,172*320
  1373.            mov si,cs
  1374.            mov ds,si
  1375.            mov si,offset logo
  1376.            mov cx,28*320/2
  1377. plsdf:
  1378.            lodsw
  1379.            add ah,196
  1380.            add al,196
  1381.            stosw
  1382.            loop plsdf
  1383.            ret
  1384. putlogo    endp
  1385.  
  1386. gettime    proc near
  1387.            mov ah,0
  1388.            int 1ah
  1389.            mov ax,dx
  1390.            mov dx,cx
  1391.            ret
  1392. gettime    endp
  1393.  
  1394. realtime   proc near
  1395. waitfor:
  1396.            call gettime
  1397.            sub ax,cs:time
  1398.            cmp ax,0
  1399.            je waitfor
  1400.            mov di,2
  1401.            shl di,5
  1402.            mov cx,ax
  1403.            mul cs:vxsec
  1404.            div di
  1405.            mov cs:vxadd,ax
  1406.            mov ax,cx
  1407.            mul cs:vysec
  1408.            div di
  1409.            mov cs:vyadd,ax
  1410.            mov ax,cx
  1411.            mul cs:vzsec
  1412.            div di
  1413.            mov cs:vzadd,ax
  1414.            ret
  1415. realtime   endp
  1416.  
  1417. fadedown   proc near
  1418.            cmp cs:dacdown,0
  1419.            je fdout
  1420.            mov di,3
  1421. fdx:
  1422.            cmp cs:ddac[di],0
  1423.            je fd2
  1424.            dec cs:ddac[di]
  1425. fd2:
  1426.            inc di
  1427.            cmp di,194*3
  1428.            jne fdx
  1429.  
  1430.            mov di,248*3
  1431. fdx2:
  1432.            cmp cs:ddac[di],0
  1433.            je fd22
  1434.            dec cs:ddac[di]
  1435. fd22:
  1436.            inc di
  1437.            cmp di,255*3
  1438.            jne fdx2
  1439.            mov ax,cs
  1440.            mov ds,ax
  1441.            mov si,offset ddac
  1442.            call savedac
  1443.            dec cs:dacdown
  1444. fdout:
  1445.            ret
  1446. fadedown   endp
  1447.  
  1448. fadeup     proc near
  1449.            cmp cs:dacup,0
  1450.            je fuout
  1451.            mov di,3
  1452. fux:
  1453.            mov ah,cs:dac[di]
  1454.            cmp cs:ddac[di],ah
  1455.            je fu2
  1456.            inc cs:ddac[di]
  1457. fu2:
  1458.            inc di
  1459.            cmp di,194*3
  1460.            jne fux
  1461.  
  1462.            mov di,248*3
  1463. fux2:
  1464.            mov ah,cs:dac[di]
  1465.            cmp cs:ddac[di],ah
  1466.            je fu22
  1467.            inc cs:ddac[di]
  1468. fu22:
  1469.            inc di
  1470.            cmp di,255*3
  1471.            jne fux2
  1472.            mov ax,cs
  1473.            mov ds,ax
  1474.            mov si,offset ddac
  1475.            call savedac
  1476.            dec cs:dacup
  1477. fuout:
  1478.            ret
  1479. fadeup     endp
  1480.  
  1481. upbase     proc near
  1482.            mov ax,cs
  1483.            mov ds,ax
  1484.            mov objbase[ 0],offset stick
  1485.            mov objbase[ 2],offset danishflag
  1486.            mov objbase[ 4],offset key
  1487.            mov objbase[ 6],offset opencube
  1488.            mov objbase[ 8],offset pyramid
  1489.            mov objbase[10],offset cube
  1490.            mov objbase[12],offset star
  1491.            mov objbase[14],offset diamond
  1492.            mov objbase[16],offset rubine
  1493.            mov objbase[18],offset cubehole
  1494.            mov objbase[20],offset ring
  1495.            mov objbase[22],offset italflag
  1496.            mov objbase[24],offset special
  1497.            mov objbase[26],offset splitcube
  1498.            ret
  1499. upbase     endp
  1500.  
  1501. stfadeup   proc near
  1502.            mov cx,64
  1503. sfun:
  1504.            push cx
  1505.            mov cx,768
  1506. sfun2:
  1507.            mov di,cx
  1508.            dec di
  1509.            mov ah,cs:dac[di]
  1510.            cmp cs:ddac[di],ah
  1511.            je noup
  1512.            inc cs:ddac[di]
  1513. noup:
  1514.            loop sfun2
  1515.            pop cx
  1516.            mov ax,cs
  1517.            mov ds,ax
  1518.            mov si,offset ddac
  1519.            push cx
  1520.            call savedac
  1521.            pop cx
  1522.            loop sfun
  1523.            ret
  1524. stfadeup   endp
  1525.  
  1526. enfade     proc near
  1527.            mov cx,64
  1528. enun:
  1529.            push cx
  1530.            mov cx,768
  1531. enun2:
  1532.            mov di,cx
  1533.            dec di
  1534.            cmp cs:ddac[di],63
  1535.            je enup
  1536.            inc cs:ddac[di]
  1537. enup:
  1538.            loop enun2
  1539.            pop cx
  1540.            mov ax,cs
  1541.            mov ds,ax
  1542.            mov si,offset ddac
  1543.            push cx
  1544.            call savedac
  1545.            pop cx
  1546.            loop enun
  1547.            mov cx,64
  1548. xenun:
  1549.            push cx
  1550.            mov cx,768
  1551. xenun2:
  1552.            mov di,cx
  1553.            dec di
  1554.            cmp cs:ddac[di],0
  1555.            je xenup
  1556.            dec cs:ddac[di]
  1557. xenup:
  1558.            loop xenun2
  1559.            pop cx
  1560.            mov ax,cs
  1561.            mov ds,ax
  1562.            mov si,offset ddac
  1563.            push cx
  1564.            call savedac
  1565.            pop cx
  1566.            loop xenun
  1567.            ret
  1568. enfade     endp
  1569.  
  1570. mulplane   proc near
  1571.            mov cx,cs:plane[0]
  1572.            mov si,cs
  1573.            mov ds,si
  1574.            mov es,si
  1575.            mov si,offset plane
  1576.            mov di,offset plane
  1577.            add si,6
  1578.            add di,6
  1579. mp:
  1580.            lodsw
  1581.            sal ax,2
  1582.            stosw
  1583.            lodsw
  1584.            sal ax,2
  1585.            stosw
  1586.            lodsw
  1587.            sub ax,22
  1588.            sal ax,2
  1589.            stosw
  1590.            loop mp
  1591.            ret
  1592. mulplane   endp
  1593.  
  1594. start      proc near
  1595.        Mov  Ah,4Ah                ; Reduce program memory size
  1596.        Mov  Bx,140000/16           ; Approx. size of compiled EXEFILE / 16 + 2
  1597.        Int  21h
  1598.  
  1599.            call mulplane
  1600.  
  1601.            mov ax,13h
  1602.            int 10h
  1603.  
  1604.            call upbase
  1605.  
  1606.  
  1607.        Mov  Ax,_Data
  1608.        Mov  Ds,Ax
  1609.  
  1610.        Call Askinit              ; Ask for the setup
  1611.        Call Initialize           ; Initialize the SoundSystem
  1612.  
  1613.        Mov  Dx,Offset FileName
  1614.        Call Loadmodule           ; Load the module
  1615.  
  1616.        Call StartPlaying         ; Roll it !
  1617.        Mov  Al,01111010b         ; Mask off all unneccesary interrupts.
  1618.        Out  21h,Al
  1619.  
  1620.            mov dx,cs
  1621.            mov ds,dx
  1622.            mov si,offset ddac
  1623.            call savedac
  1624.            call putlogo
  1625.  
  1626.            mov si,cs
  1627.            mov ds,si
  1628.            mov si,offset danishflag
  1629.            call changeall
  1630.  
  1631.            call stfadeup
  1632.  
  1633. xxxxx:
  1634.            call gettime
  1635.            mov cs:time,ax
  1636.  
  1637.            call cleardbl
  1638.            call rotvectors
  1639.            call sort_list
  1640.            call drawvect
  1641. ;           call realtime
  1642.            call updvectors
  1643.            call copydbl
  1644.            call handletext
  1645.            call fadedown
  1646.            call fadeup
  1647.  
  1648.            cmp cs:outnow,1
  1649.            je getout
  1650.  
  1651.            in al,60h
  1652.            cmp al,1
  1653.            je getout
  1654.            jmp xxxxx
  1655. getout:
  1656.            mov al,0
  1657.            out 21h,al
  1658.  
  1659.            call enfade
  1660.            call stopplaying
  1661.            call dealloc
  1662.  
  1663.            mov ax,4c00h
  1664.            int 21h
  1665.            ret
  1666. start      endp
  1667.  
  1668. _code      ends
  1669.            end start
  1670.